home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20010306-20010921
/
000245_keithuse@synco_pator.com_Thu Jul 5 17:43:32 EDT 2001.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
5KB
|
139 lines
Article: 12570 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!panix!howland.erols.net!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail
Newsgroups: comp.protocols.kermit.misc
From: keithuse@synco_pator.com (Keith Doyle)
Subject: Any way to alter Kermit "quit" so I don't have to "kill?"
Reply-To: keithuse@synco_pator.com (Keith Doyle)
Organization: Rexx Electronic Communications
X-Newsreader: trn 4.0-test74 (May 26, 2000)
Lines: 120
Message-ID: <h_417.5247$oa1.534611@newsread1.prod.itd.earthlink.net>
Date: Thu, 05 Jul 2001 21:28:45 GMT
NNTP-Posting-Host: 207.167.89.8
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread1.prod.itd.earthlink.net 994368525 207.167.89.8 (Thu, 05 Jul 2001 14:28:45 PDT)
NNTP-Posting-Date: Thu, 05 Jul 2001 14:28:45 PDT
X-Received-Date: Thu, 05 Jul 2001 14:26:29 PDT (newsmaster1.prod.itd.earthlink.net)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12570
Hi,
I've been using a dialing program under Linux that will connect
to a shell account and do a bunch of intelligent stuff including
transfer files. I had been using Zmodem via lrz/lsz with success
for a long time, but I'm finding it's just not working anymore,
due to the fact that I can only connect to the target machine now
via some kind of POP service that uses telnet and is none too
transparent. It may even be 7 bit, it's not clear, and I have
no control over it.
At any rate, I found that I could manually use kermit to perform
a successful transfer. So I figured the obvious thing to do was to
replace my lrz/lsz logic with C-kermit equivalents. This worked
fine but with one problem-- after the transfer finished, C-kermit
does something that causes a disconnect. So, I did some research
on deja/google and found some references to some mention of the
subject in a documentation file somewhere:
>Many people want to be able to make a dialout connection with UNIX
>C-Kermit, but then use some other software on the connection that C-Kermit
>made. They quickly find that when they exit from C-Kermit, that the
>connection is gone before they can start the other application.
>
>It is a fundamental property of UNIX that when a process exits, then every
>file that was opened by that process is automatically closed by UNIX.
>Closing a terminal device (such as a dialout tty device) hangs it up.
>There is nothing the process can do about it.
>
>However, many workarounds are possible. Here are just a few:
>
> . Read about the REDIRECT command in the ckcker.upd file.
>
> . Find out the file descriptor of the open device (it is given by
> C-Kermit's \v(ttyfd) variable) and then run ("!") your other program
> from the C-Kermit prompt, feeding it the file descriptor, e.g. through
> shell redirection or a command line option (the method depends on the
> other program, the capabilities of the shell, etc).
>
> . After Kermit makes the connection, type "show comm" to find out the
> filename of the lock file. Then suspend Kermit, then delete the lock
> file, then start the other program and tell it to open the same tty
> device.
Now my original approach used lrz something like the following:
lrz </dev/modem >/dev/modem
Since this doesn't hang up the line, I presume that the issue is NOT
"close" of the device.
So I tried serveral things. I noticed that it is possible to pass in
an open file descriptor and have kermit use that. But, I gathered
you can't just do:
kermit -r -i -l 0 </dev/modem
As this is only open for input, and kermit is going to need bidirectional
I/O on the FD. So I tried the following in bash:
kermit -r -i -l 3 3<>/dev/modem
According to the bash spec, this should open descriptor 3 for read/write.
Couldn't get this to work though.
I then noticed that "modem type" was a setting which included a code
for hangup-- usually ATH0 or something. Maybe this was the problem I
thought, and did a "set modem none" in the .kermrc to try to circumvent
it. No effect.
So lastly, I figured ok, let's see if it really is the close of the
device or something *specific* kermit is doing on exit. I manually
invoked kermit so that it wouldn't exit, and instead of doing a "quit"
after the transfer, I switched to another window and did a kill -9
on the kermit process. Voila! no disconnect occurred.
So, I've since implemented a solution to the problem which entails
a kermit script that does something like this:
set modem none
set line /dev/modem
set file type bin
receive
!/tmp/killkerm
And invokes kermit like this:
echo "kill -9 $$" >/tmp/killkerm
chmod a+x /tmp/killkerm
exec kermit -y kermitscript
And it works like a choim. However, it is a major kludge. I'm using
it because it works, but does anyone know how I can get kermit to NOT
do whatever it is doing to the device before it exits so I don't have
use kill? Perhaps it's doing some kind of rude stty/ioctl that's
causing it?
--
Keith Doyle <http://www.syncopator.com/carousel>
(to send me an E-letter, remove underbars in reply address)
"Simple ain't easy." -- Thelonious Monk